<!DOCTYPE html>
<html>
<head lang="zh">
    <meta charset="UTF-8">
    <!--#include virtual="/public/inc/head.html"-->
    <title>成员管理</title>
    <!--#include virtual="/public/inc/seajs.html" -->
    <link rel="stylesheet" type="text/css" href="/ydxs_static/public/css/css.css" />
    <link rel="stylesheet" type="text/css" href="/public/css/index.css" />
    <style>
        .left-panel-title { height: 40px; line-height: 40px; padding-left: 20px; background-color: #f7f7f7; }
        .left-panel { width: 376px }
        .right-panel { width: 100%; }
        /* 自适应布局 */
        .auto-wrap { width: 100%;}
        .selected {background-color: #fff9ee;}
        .options li {float:left; cursor: pointer; margin: 0 5px;}
        .options li a {text-decoration: none;}
        .options li a:hover { text-decoration: underline;}
        .search-title { font-size: 14px; font-weight: 400; float: left; margin: 0 15px 0 6px; }
        .form-item { margin-bottom:20px; text-align: center;}
        .form-item .name {  width: 15%; text-align: right; float: left;margin-right: -94px; margin-top: 4px;}
        .form-item input { width:66%;}
        .form-item .required{color:#f00;}
        .form-item .invalidate { font-size: 10px; display: block; text-align: left; position: relative; left: 22%; margin-top: 5px;}
        .warning {color: #f00;}
        input[type="text"]::-ms-clear{display: none;}
        .belong-project{ padding: 5px 0; max-height: 34px; overflow: hidden; line-height: 18px; overflow : hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;}
    </style>
</head>
<body data-func-codes="00002701" data-permission="00002701-00">
    <!--#include virtual="/public/inc/top_main.html" -->
    <div class="container">
        <div class="wrap clearfix">
            <!--#include virtual="/public/inc/side_main.html" -->
            <div class="content" ng-controller="MemberController">
                <div class="auto-wrap">
                    <div class="auto-wrap-con">
                        <div class="fl right-panel">
                            <div class="table-header clearfix">
                                <div class="search clearfix fl">
                                    <span class="fl lh30">成员状态：</span>
                                    <div style="width:75px" class="fl mr20">
                                        <div ui-combobox data="searchFields" text-field="name" value-field="value"
                                        ng-model="search_field"></div>
                                    </div>
                                    <span class="fl lh30">已绑定ERP用户：</span>
                                    <div style="width:75px" class="fl mr20">
                                        <div ui-combobox data="searchErpFields" text-field="name" value-field="value"
                                             ng-model="search_erp_field"></div>
                                    </div>
                                    <span class="fl lh30">成员列表：</span>
                                    <input type="text" class="input-text fl" placeholder="姓名/手机号/所属项目名称" ng-model="keyword" ng-enter="searchMembers()" style="width:300px">
                                    <button class="fl btn" ng-click="searchMembers()">搜索</button>
                                </div>
                                <div class="fr btn-group">
                                    <a href="javascript:;" class="btn permission p-00002701-01-inline-block" ui-dialog="添加用户" ui-dialog-url="dialog/add_user.html" ui-dialog-init="memberManager.init($dialogScope)"
                                    ui-dialog-cache="false" ui-dialog-ok="memberManager.create()">添加用户</a>
                                    <a href="javascript:;" class="btn permission p-00002701-02-inline-block" ui-dialog="引入ERP用户" ui-dialog-url="dialog/import_erp.html" ui-dialog-init="erpUserImporter.init($dialogScope)"
                                    ui-dialog-cache="false" ui-dialog-ok="erpUserImporter.submit($dialog)">引入ERP用户</a>
                                </div>
                            </div>
                            <div class="table-wrap mt10">
                                <table width="100%">
                                    <thead>
                                        <tr>
                                            <th style="width:50px">序号</th>
                                            <th style="width:88px">姓名</th>
                                            <th style="width:120px">手机号</th>
                                            <th style="width:111px">已绑定ERP用户</th>
                                            <th style="width:60px">状态</th>
                                            <th style="width:90px">初始密码</th>
                                            <th style="width:120px">当前所属项目</th>
                                            <th style="width:120px">历史所属项目</th>
                                            <th style="width: 220px;"></th>
                                        </tr>
                                    </thead>
                                    <tbody ng-show="memberList && memberList.length">
                                        <tr ng-repeat="member in memberList" ng-mouseover="member.hover = true" ng-mouseleave="member.hover = false">
                                            <td height="45" ng-cloak>{{$index + 1}}</td>
                                            <td ng-cloak>{{member.user_name}}</td>
                                            <td ng-cloak>{{member.mobile_tel}}</td>
                                            <td ng-cloak>{{member.user_code}}</td>
                                            <td ng-cloak>{{member.status}}</td>
                                            <td ng-cloak>{{member.ini_pwd}}</td>
                                            <td ng-cloak><div class="belong-project" title="{{member.teamprojects}}">{{member.teamprojects}}</div></td>
                                            <td ng-cloak><div class="belong-project" title="{{member.historyprojects}}">{{member.historyprojects}}</div></td>
                                            <td>
                                                <ul class="options ng-hide" ng-show="member.hover">
                                                    <!-- isdisabled : 0 在职，1 离职 is_on_holiday : 0 在岗 ，1 休假 -->
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-05-inline" ng-if="member.isdisabled == '0' && member.is_binderp == '否'" ui-dialog="选择ERP用户" ui-dialog-url="dialog/bind_user.html" ui-dialog-cache="false"
                                                        ui-dialog-init="erpUserBinder.init($dialogScope,$dialog,member.s_userId)" ui-dialog-ok="erpUserBinder.submit($dialog)">绑定</a>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-05-inline" ng-click="unbindErp(member.s_userId)" ng-if="member.isdisabled == '0' && member.is_binderp == '是'">取消绑定</a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-04-inline" ng-click="leaveMember(member.s_userId)" ng-if="member.is_on_holiday == '0' && member.isdisabled == '0'">置为离职</a>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-04-inline" ng-click="enableMember(member.s_userId)" ng-if="member.is_on_holiday == '0' && member.isdisabled != '0'">置为在职</a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-08-inline" ng-click="holidayMember(member.s_userId)" ng-if="member.isdisabled == '0' && member.is_on_holiday == '0'">标识休假</a>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-08-inline" ng-click="cleanHolidayMember(member.s_userId)" ng-if="member.isdisabled == '0' && member.is_on_holiday != '0'">结束休假</a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-02-inline" ui-dialog="编辑用户" ui-dialog-url="dialog/add_user.html" ui-dialog-cache="false" ui-dialog-init="memberManager.init($dialogScope,member)"
                                                        ui-dialog-ok="memberManager.update()">编辑</a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-03-inline"
                                                            ui-confirm ui-confirm-title="删除" 
                                                            ui-confirm-ok="deleteMember(member.s_userId)"
                                                            ui-confirm-message="确定删除该成员？">删除</a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" class="c-orange permission p-00002701-07-inline" ui-dialog="重设密码" ui-dialog-url="dialog/reset_pwd.html" ui-dialog-cache="false" ui-dialog-init="passwordReseter.init($dialogScope,member.s_userId)"
                                                        ui-dialog-ok="passwordReseter.submit()">重设密码</a>
                                                    </li>
                                                </ul>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="no-data" ng-if="memberList && !memberList.length">
                                    <span>暂无数据</span>
                                </div>
                            </div>
                            <div ui-pagination="" page-index="memberListPager.pageIndex" page-size="memberListPager.pageSize" total="memberListPager.total"
                            changed="memberListPager.change($pageIndex,memberListPager.pageSize)"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--#include virtual="/public/inc/footer.html" -->

    <script type="text/javascript">
        seajs.use(['/public/js/service/user_manage/member_manage']);
    </script>
</body>

</html>